#ifndef PCR_H_
#define PCR_H_

#include "recbase.h"
#include "rectype.h"
#include "stdffield.h"
#include <string>

namespace opsrc {
    namespace stdf {

        class Pcr : public opsrc::stdf::RecBase
        {
        public:
            Pcr(stdf_rec stdfrec,  int reclen, std::ios::pos_type fileRecFirstBytePosition, int orderindex, endian e, char* buf);
            virtual ~Pcr();

            const StdfField<int> getHeadNum() const;
            void setHeadNum(StdfField<int> headnum);

            const StdfField<int> getSiteNum() const;
            void setSiteNum(StdfField<int> sitenum);

            const StdfField<long> getPartCount() const;
            void setPartCount(StdfField<long> partcnt);

            const StdfField<long> getRetestCount() const;
            void setRetestCount(StdfField<long> retestcnt);

            const StdfField<long> getAbortCount() const;
            void setAbortCount(StdfField<long> abortcnt);

            const StdfField<long> getGoodCount() const;
            void setGoodCount(StdfField<long> goodcnt);

            const StdfField<long> getFunctionalCount() const;
            void setFunctionalCount(StdfField<long> functcnt);

            void readFields(char *buf);

        protected:
            Pcr();

        private:
            StdfField<int> head_num;	// u1
            StdfField<int> site_num;	// u1
            StdfField<long> part_cnt;	// u4
            StdfField<long> rtst_cnt;	// u4
            StdfField<long> abrt_cnt;	// u4
            StdfField<long> good_cnt;	// u4
            StdfField<long> func_cnt;	// u4

            endian en;
            bool decodeFields;
        };

    }
}

#endif /*PCR_H_*/
